package com.vpx.server.controller.system;

import com.vpx.server.bean.order.base.BaseDeleteOrder;
import com.vpx.server.bean.order.base.BaseIdOrder;
import com.vpx.server.bean.order.system.SysExceptionLogPageOrder;
import com.vpx.server.bean.result.base.BaseDeleteResult;
import com.vpx.server.bean.result.system.SysExceptionLogPageResult;
import com.vpx.server.bean.result.system.SysExceptionLogResult;
import com.vpx.server.framework.authority.AuthPoicy;
import com.vpx.server.framework.authority.RequestAuth;
import com.vpx.server.framework.base.ResultMsg;
import com.vpx.server.service.system.SysExceptionLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author liuks
 * @title: vpx
 * @module: 异常日志
 * @description: 异常日志接口
 * @date 2021/09/13 11:21
 */
@RestController
@RequestMapping(value = "/api/exceptionLog")
@Api(tags = "异常日志")
public class SysExceptionLogController {

    @Autowired
    private SysExceptionLogService sysExceptionLogService;

    @DeleteMapping("deleteById")
    @ApiOperation("删除异常日志")
    @RequestAuth(poicy = AuthPoicy.AUTH)
    public ResultMsg deleteById(@RequestBody BaseDeleteOrder order) {
        return sysExceptionLogService.deleteById(order);
    }

    @GetMapping("findById")
    @ApiOperation("查询异常日志")
    @RequestAuth(poicy = AuthPoicy.AUTH)
    public ResultMsg<SysExceptionLogResult> findById(BaseIdOrder order) {
        return sysExceptionLogService.findById(order);
    }

    @GetMapping("pageQuery")
    @ApiOperation("分页查询异常日志列表")
    @RequestAuth(poicy = AuthPoicy.AUTH)
    public ResultMsg<SysExceptionLogPageResult> pageQuer(SysExceptionLogPageOrder order) {
        return sysExceptionLogService.pageQuery(order);
    }

}
